package com.surveillance.tests;

import java.util.ArrayList;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.surveillance.BO.BOLayer;
import com.surveillance.entities.Etudiant;
import com.surveillance.entities.Salle;
import com.surveillance.entities.Servicee;

public class TestServices {
	public static void main(String[] args) {

		ApplicationContext appContext = new ClassPathXmlApplicationContext(
				"beanLocations.xml");
		BOLayer<Servicee> serviceBO = (BOLayer<Servicee>) appContext
				.getBean("ServiceBO");
		/*
		 * Servicee service = new Servicee(); service.setDept("Marketing");
		 * service.setEffectif(123); service.setNom("service machin");
		 * serviceBO.save(service);
		 */
		Servicee fetchedService = serviceBO.findByID(new Long(1));
		System.out.println("displaying the fetched service infos ");
		System.out.println(fetchedService);
		fetchedService.setDept("Any other dept name");
		serviceBO.update(fetchedService);
		fetchedService = serviceBO.findByID(new Long(1));
		System.out.println("displaying the fetched service infos after update");
		System.out.println(fetchedService);

	}
}
